package com.mercenary.wein.screenControl.ui.batch;

import com.mercenary.wein.screenControl.command.CommandTool;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.ScrollPaneConstants;
import javax.swing.border.Border;

public class AcceptNearbyGreet extends JDialog {
    GroupCheckBoxPanel RequestJ1 = new GroupCheckBoxPanel();//面板1
    JPanel RequestJ2 = new JPanel();//面板22
    JPanel LocationJ6 = new JPanel();
    int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
    int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER;//
    JButton j1 = new JButton("一键接受");
    static JFrame locationjf = new JFrame();
    String location;

    public AcceptNearbyGreet() {
        super(locationjf, "接收附近人打招呼");
        setBounds(200, 100, 700, 550);
        setLayout(new BorderLayout());
        setVisible(true);
        add(RequestJ1, BorderLayout.WEST);
        add(RequestJ2, BorderLayout.EAST);
        RequestJ1.setPreferredSize(new Dimension(180, 550));//鐠佸墽鐤嗘径褍鐨�
        RequestJ1.setBackground(Color.WHITE);
        RequestJ2.setPreferredSize(new Dimension(500, 550));
        RequestJ2.setBackground(Color.WHITE);
        RequestJ2.add(j1);
        Border titleBorder1 = BorderFactory.createTitledBorder("已选在线设备");// 鐠佸墽鐤嗛棃銏℃緲鏉堣顢嬮敍灞界杽閻滄澘鍨庣紒鍕攱閻ㄥ嫭鏅ラ弸锟�       .鐠佸墽鐤嗛棃銏℃緲鏉堣顢嬫０婊嗗
        RequestJ1.setBorder(titleBorder1);
        j1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                CommandTool.acceptHi(RequestJ1.getSelectedDevices());
            }
        });
    }

    public void itemStateChanged(ItemEvent e) {
        // TODO Auto-generated method stub

    }

    public void actionPerformed(ActionEvent e) {
        // TODO Auto-generated method stub

    }

    public static void main(String[] arge) {
        new AcceptNearbyGreet();


    }


}
